﻿/* 
 * Copyright (c) 2010 Letwory Interactive
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * -- Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * -- Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * Original contributor: Nathan Letwory
 */

using System;

namespace VerseSharp
{
    public delegate void ObjectTransformScaleReal64Callback(ObjectTransformScaleReal64Command command);

    public class ObjectTransformScaleReal64Command : IVerseCommand
    {
        public CommandID ID { get { return CommandID.ObjectTransformScaleReal64; } }
        public uint NodeID;
        public double ScaleX;
        public double ScaleY;
        public double ScaleZ;

        public void Deserialize(byte[] source, ref int pos)
        {
            NodeID = Utils.GetUInt32(source, ref pos);
            ScaleX = Utils.GetReal64(source, ref pos);
            ScaleY = Utils.GetReal64(source, ref pos);
            ScaleZ = Utils.GetReal64(source, ref pos);
        }

        public void Serialize(byte[] destination, ref int pos)
        {
            Utils.PutUInt32(destination, ref pos, NodeID);
            Utils.PutReal64(destination, ref pos, ScaleX);
            Utils.PutReal64(destination, ref pos, ScaleY);
            Utils.PutReal64(destination, ref pos, ScaleZ);
        }
    }
}
